	var data = {
				teacher:[
				    {id:0,name:"张老师",sex:"男"},
				    {id:1,name:"李老师",sex:"男"},
				    {id:2,name:"王老师",sex:"女"}
				],
				student:[
				    {id:0,name:"学生A",sex:"男",tId:0},
				    {id:1,name:"学生B",sex:"男",tId:0},
				    {id:2,name:"学生C",sex:"女",tId:1},
				    {id:3,name:"学生D",sex:"女",tId:1},
				    {id:4,name:"学生E",sex:"男",tId:2},
				    {id:5,name:"学生F",sex:"女",tId:2}
				    ]
				};



	var setting = {
				    data:{//表示tree的数据格式
				        simpleData:{
				            enable:true,//表示使用简单数据模式
				            idKey:"id",//设置之后id为在简单数据模式中的父子节点关联的桥梁
				            pidKey:"pId",//设置之后pid为在简单数据模式中的父子节点关联的桥梁和id互相对应
				            rootId:"null"//pid为null的表示根节点
				        }
				    },
				    view:{//表示tree的显示状态
				        selectMulti:false//表示禁止多选
				    },
				    check:{//表示tree的节点在点击时的相关设置
				        enable:true,//是否显示radio/checkbox
				        chkStyle:"checkbox",//值为checkbox或者radio表示
				        checkboxType:{p:"",s:""},//表示父子节点的联动效果
				        radioType:"level"//设置tree的分组
				    },
				    //选中文字，自动勾选复选框
				    callback: { 
                    onClick: function (e, treeId, treeNode, clickFlag) { 
                       zTree.checkNode(treeNode, !treeNode.checked, true); }                                                                       
                    } 
				    
			} 
				

	function initTree(){
		
	    var teacherList = data.teacher;
	    var studentList = data.student;
	    var treeData = [];
	    treeData.push({id:"root",name:"学校",pId:null});
	    for(var i=0,il=teacherList.length;i<il;i++){
	        teacherList[i].pId = "root";
	        treeData.push(teacherList[i]);
	    }
	    for(var i=0,il=studentList.length;i<il;i++){
	　　　　 studentList[i].id = "s"+studentList[i].id;
	        studentList[i].pId = studentList[i].tId;
	        treeData.push(studentList[i]);
	    }
	    zTree=$.fn.zTree.init($("#des_school"),setting,treeData);
	    
	    
	  }	
	  //展开目标节点以及其父节点
      function selectNode() {
            var treeObj = $.fn.zTree.getZTreeObj("des_school");
//          treeObj.expandAll(true);
            var treenode = treeObj.getNodeByParam("id", 1, null);
//          var treenode = treeObj.getNodeByTId(1);
          console.log(treenode);
//          treeObj.expandNode(treenode, true, true, true);
//          treeObj.selectNode(treenode);
        }
      function explandSelected(){
      	 var treeObj = $.fn.zTree.getZTreeObj("des_school");
      	 //获取被选中的节点
      	 var nodes = treeObj.getSelectedNodes();
      	  console.log(nodes);
      	  for(var i in nodes){
      	  	treeObj.expandNode(nodes[i],true,true,true);
      	    treeObj.selectNode(nodes[i]);
      	    //让被选中的节点处于被勾选的状态
      	    treeObj.checkNode(nodes[i], true, true);
      	  }
      }
      
      function functionTest(){
      	var numArr=[1,2,3,4,5];
      	for (var i in numArr) {
      		console.log(numArr[i]);
      	}
      }
      
      function findUniqueNode(){
      	 var treeObj = $.fn.zTree.getZTreeObj("des_school");
      	 var treenode = treeObj.getNodeByParam("name", '学生F', null);
      	 treeObj.expandNode(treenode, true, true, true);
      	 treeObj.selectNode(treenode);
      	 treeObj.checkNode(treenode);
      }
